import cv2

# 读取图像
image = cv2.imread('../temp/image.jpg')
if image is None:
    print('Cannot read image file')
    exit(-1)

# 进行图像缩放
resized = cv2.resize(image, None, fx=0.5, fy=0.5)

# 显示原始图像和缩放后的图像
cv2.namedWindow('Original Image', cv2.WINDOW_NORMAL)
cv2.namedWindow('Resized Image', cv2.WINDOW_NORMAL)
cv2.imshow('Original Image', image)
cv2.imshow('Resized Image', resized)

cv2.waitKey(0)
cv2.destroyAllWindows()
